﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CMS.BLL;

public partial class Controls_ContactUs_ctrContact_home : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.SetData(); 
        }
    }

    private void SetData()
    {
        int nCurrentLanguage = Support.GetCurrentLanguage(); 
        Company objCompany = new Company();
        DataTable dtbCompany = new DataTable();
        dtbCompany = objCompany.Search();
        int nLastID = ConvertData.ConvertToInt(dtbCompany.Rows[0]["CompanyID"]);
        objCompany.LoadById(nLastID);
       
        lblEmail.Text = "Email:" + " " + objCompany.Data.Email;
        lblFax.Text = "Fax:" + " " + objCompany.Data.Fax;
        lblTel.Text = "Tel:" + " " + objCompany.Data.Tel;
        lblWebsite.Text = "Website:" + " " + objCompany.Data.Website;
        switch (nCurrentLanguage)
        { 
            case 1:
                lblAddress.Text = "Địa chỉ:" + " " + objCompany.Data.Address1;
                lblCompanyName.Text = objCompany.Data.CompanyName1;
                lblContactUs.Text = MultipleLanguage.CONTACT_US[nCurrentLanguage - 1];
                break;
            case 2:
                lblAddress.Text = "Address:" + " " + objCompany.Data.Address2;
                lblCompanyName.Text = objCompany.Data.CompanyName2;
                lblContactUs.Text = MultipleLanguage.CONTACT_US[nCurrentLanguage - 1];
                break;
            case 3:
                lblAddress.Text = "Address:" + " " + objCompany.Data.Address3;
                lblCompanyName.Text = objCompany.Data.CompanyName3;
                lblContactUs.Text = MultipleLanguage.CONTACT_US[nCurrentLanguage - 1];
                break;
        }
    }
}
